#!/usr/bin/env escript
%% -*- erlang -*-
%%! -smp enable -pa ebin -enable-feature maybe_expr -env ERL_LIBS deps

-module(compare).

-mode(compile).

main([Source, Dest]) ->
    main([Source, Dest, "result"]);
main([Source, Dest, OutPut0]) ->
    OutPut =
        case OutPut0 of
            "result" ->
                result;
            "mysql" ->
                mysql;
            File ->
                File
        end,

    case erl_sql_compare:start(Source, Dest, [{output, OutPut}]) of
        {ok, Lines} ->
            io:format("compare result: ~n~s~n", [Lines]);
        _ ->
            skip
    end.